<template>
  <div>
    <div class="main">
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </div>
    <div>
      <van-tabbar v-model="active">
        <van-tabbar-item  v-for="item,index in tabbar" :to="item.path"
        :key="index" :icon="item.icon">{{item.txt}}</van-tabbar-item>
      </van-tabbar>
    </div>  
  </div>  
</template>

<script>
export default {
  data(){
    return{
      active:0,
      tabbar:[
        {txt:'首页',icon:"home-o",path:"/shou"},
        {txt:'分类',icon:"search",path:"/fen"},
        {txt:'购物车',icon:"friends-o",path:"/shop"},
        {txt:'我的',icon:"setting-o",path:"/my"},
      ]
    }
  }
}
</script>

<style lang="scss">

</style>